import React, { useEffect, } from 'react';

const Child1 = (props) => {

  useEffect(() => {
    console.log(props.children);
    console.log(React.Children.count(props.children));
    console.log(React.Children.only(props.children));
    console.log(React.Children.toArray(props.children))
  }, []);

  return (
    <div>
      Child1
      { React.Children.forEach(props.children, function(obj, index) {
        console.log(index, this);
        return obj;
      }.bind({name: "fruitj",})) }
    </div>
  );
};

export default Child1;
